<!DOCTYPE html>
<title>Test Results</title>
<link rel="stylesheet" href="/stylesheets/testfile.css" />
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m
)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-55762617-8', {'siteSpeedSampleRate': 100});
  ga('send', 'pageview');
</script>
<h1>Test Results
{{- if or .Builder .TestType .Name }}
- {{ .Builder }} {{ .TestType }} {{ .Name -}}
{{- end -}}
</h1>
<div>
    <table>
        <thead>
            <tr>
                <th>Master
                <th>Builder
                <th>Test Type
                <th>Build Number
                <th>File
                <th>Date
        <tbody>
            {{- range .Files -}}
            <tr>
                {{- if and .Builder .Name -}}
                <td><a href="/testfile?master={{ .Master }}">{{ .Master }}</a>
                <td><a href="/testfile?builder={{ .Builder }}">{{ .Builder }}</a>
                <td>
                    {{ if .TestType }}
                    <a href="/testfile?testtype={{ .TestType }}">{{ .TestType }}</a>
                    {{ end }}
                <td>
                    {{ if not .BuildNumber.IsNil }}
                    <a href="/testfile?buildnumber={{ .BuildNumber }}" >{{ .BuildNumber }}</a>
                    {{ end }}
                <td><a href="/testfile?builder={{ .Builder }}&name={{ .Name }}&master={{ .Master }}&testtype={{ .TestType }}{{ if not .BuildNumber.IsNil }}&buildnumber={{ .BuildNumber }}{{ end }}">{{ .Name }}</a>
                <td>
                    <script>
                        var beforeQueryParameter = 'before={{ .LastMod | timeParams }}';
                        var url = window.location.toString();
                        if (url.indexOf('before') == -1) {
                            url += (url.indexOf('?') == -1 ? '?' : '&') + beforeQueryParameter;
                        } else {
                            url = url.replace(/before=[^&]*/, beforeQueryParameter);
                        }
                        document.write('<a href="' + url + '">' + new Date({{ .LastMod | timeJS }}).toLocaleString() + '</a>')
                    </script>
                {{- end -}}
            {{- end -}}
    </table>
</div>
